/**
	Singleton wrapper for flash CSS. 
	Loads and stores a single stylesheet.

	@author Chandler McWilliams
	@version 2005-07-02
	
	@usage
		<code>
		var c = CSS.getInstance();
		c.load(CSSURL,
			function() {
				//do stuff 
			}
		);
		</code>
		
		then to apply the style
		<code>
		text_txt.styleSheet = CSS.getInstance();
		</code>

*/
dynamic class timber.controller.CSS extends TextField.StyleSheet
{
	private static var _instance = null;
	private var callback;
	
// ===========================================================
// - CONSTRUCTOR
// ===========================================================
	private function CSS() {}

// ===========================================================
// - GET SINGLETON INSTANCE
// ===========================================================
	public static function getInstance() {
		if (_instance == null) {
			CSS._instance = new CSS();
		}
		return CSS._instance;
	}

	public function load(theurl, thecallback) {
		callback = thecallback;
		super.load(theurl);
	}
	
	public function onLoad(ok) {
		if (ok) callback();
	}
}